unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ZAbstractRODataset, ZAbstractDataset, ZDataset, ZConnection,
  StdCtrls, DB, dbf;

type
  TForm1 = class(TForm)
    dbf2: TDbf;
    lbl1: TLabel;
    con1: TZConnection;
    zqry1: TZQuery;
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
var
  i:Integer;
begin
zqry1.SQL.Add('PRAGMA synchronous=OFF');
zqry1.ExecSQL;
for i:=1 to dbf2.RecordCount do
  begin
  zqry1.SQL.Clear;
  zqry1.SQL.Add('insert into taxinsp values('+quotedstr(AnsiToUtf8(dbf2.Fields.fieldbyname('code').value))+','+quotedstr(AnsiToUtf8(dbf2.Fields.fieldbyname('num').value))+','+quotedstr(AnsiToUtf8(dbf2.Fields.fieldbyname('c_sti').value))+','+quotedstr(AnsiToUtf8(dbf2.Fields.fieldbyname('name').value))+')');
  zqry1.ExecSQL;
  lbl1.Caption:=inttostr(i);
  form1.Refresh;
  dbf2.Next;
  end;
end;

end.
